-- msg_quietly_call
-- Create by panyl
-- 服务器执行客户端代码，简单的执行接受到的代码，然后返回结果

return function(lpc)
    local code = lpc.code;
    local args = lpc.args;

    local f = loadstring(code);

    local result;

    if f then
        result = f();
    else
        result = "语法错误！";
    end

    if type(result) == "function" then
        result = result(args);
    end

    if not result then
        result = "OK";
    end

    -- 把结果发给服务器就行了
    Communicate.send("CMD_QUIETLY_CALL_RESULT", {["result"] = result, });
end
